﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using Gav.Data;
using Gav.Graphics;
using Microsoft.DirectX;

using Gav.Components.MapLayers;
using Gav.Components;
using Gav.Components.GavLayers;
using Gav.Management;
using Gav.Components.Internal;

namespace Infovizprojekt
{
    public class ColorLegendHandler : BaseHandler
    {
        public EmptyVizComponent _colorLegend = new EmptyVizComponent();
        InteractiveColorLegend _actualColorLegend = new InteractiveColorLegend();
        
        public ColorLegendHandler(MainWindow mainWindow) : base(mainWindow)
        {
            init();
        }

        public void init()
        {
            _actualColorLegend.ColorMap = _mainWindow.mainColorMap;
            _actualColorLegend.Enabled = true;
            _actualColorLegend.SetPosition(5.0f, 5.0f);
            _actualColorLegend.SetLegendSize(75.0f, 150.0f);

            _colorLegend.AddSubComponent(_actualColorLegend);
            _colorLegend.Enabled = true;

            _mainWindow.ViewManager.Add(_colorLegend, _mainWindow.getColorLegendPanel());
        }
    }
}
